

#import <Foundation/Foundation.h>
#import "WXUtil.h"
#import "ApiXml.h"
/*
 // 签名实例
 // 更新时间：2015年3月3日
 // 负责人：李启波（marcyli）
 // 该Demo用于ios sdk 1.4
 
 //微信支付服务器签名支付请求请求类
 //============================================================================
 //api说明：
 //初始化商户参数，默认给一些参数赋值，如cmdno,date等。
 -(BOOL) init:(NSString *)app_id (NSString *)mch_id;
 
 //设置商户API密钥
 -(void) setKey:(NSString *)key;
 
 //生成签名
 -(NSString*) createMd5Sign:(NSMutableDictionary*)dict;
 
 //获取XML格式的数据
 -(NSString *) genPackage:(NSMutableDictionary*)packageParams;
 
 //提交预支付交易，获取预支付交易会话标识
 -(NSString *) sendPrepay:(NSMutableDictionary *);
 
 //签名实例测试
 - ( NSMutableDictionary *)sendPay_demo;
 /Users/wangliang/Downloads/wechat_sdk_sample_ios_v3_pay/wechat_sdk_sample_ios_payV3/lib/payRequsestHandler.mm
 //获取debug信息日志
 -(NSString *) getDebugif/Users/wangliang/Downloads/wechat_sdk_sample_ios_v3_pay/wechat_sdk_sample_ios_payV3/lib/WXUtil.mmo;
 
 //获取最后返回的错误代码
 -(long) getLasterrCode;
 //============================================================================
 */

// 账号帐户资料
//更改商户把相关参数后可测试

#define APP_ID          @"wxff3a40fb5f73f64f"               //APPID
#define APP_SECRET      @"5b43c6cf3916236cbac824ebd62cce01" //appsecret
//商户号，填写商户对应参数
#define MCH_ID          @"1245687302"
//商户API密钥，填写相应参数
#define PARTNER_ID  @"MIIEaDCCA9GgAwIBAgIDAyePMA0GCSqGSIb3DQEBBQUAMIGKMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEMMAoGA1UECxMDV1hHMRMwEQYDVQQDEwpNbXBheW1jaENBMR8wHQYJKoZIhvcNAQkBFhBtbXBheW1jaEB0ZW5jZW50MB4XDTE1MDYxMTAyMTYwOFoXDTI1MDYwODAyMTYwOFowgZ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AAOBgQBX54Bu5Mcu6i7iLu4c7s7R6iDOBh18wozQDTbQB6h6CwdIB2jtZ2nL2fiZUm1bsbuhBMnXBHHYNk2Aa7arulbJAXBU6E6lFlfdyDoIFKFzvz64QB9PtrjS/2/Te7ByKzodadLdkZbEVzAAV2sR0dmirNRljkBIxKa3CK9GbWig9Q=="

//支付结果回调页面
#define NOTIFY_URL      @"http://wxpay.weixin.qq.com/pub_v2/pay/notify.v2.php"
//获取服务器端支付数据地址（商户自定义）
#define SP_URL          @"http://wxpay.weixin.qq.com/pub_v2/app/app_pay.php"


@interface payRequsestHandler : NSObject{
	//预支付网关url地址
    NSString *payUrl;

    //lash_errcode;
    long     last_errcode;
	//debug信息
    NSMutableString *debugInfo;
    NSString *appid,*mchid,*spkey;
}
//初始化函数
-(BOOL) init:(NSString *)app_id mch_id:(NSString *)mch_id;
-(NSString *) getDebugifo;
-(long) getLasterrCode;
//设置商户密钥
-(void) setKey:(NSString *)key;
//创建package签名
-(NSString*) createMd5Sign:(NSMutableDictionary*)dict;
//获取package带参数的签名包
-(NSString *)genPackage:(NSMutableDictionary*)packageParams;
//提交预支付
-(NSString *)sendPrepay:(NSMutableDictionary *)prePayParams;
//签名实例测试
- ( NSMutableDictionary *)sendPay_demo:(NSDictionary *)orderDic;

@end